<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>编辑用户</title>
<script type="text/javascript">
	function updateUser(){
		var form = document.forms[0];
		form.action = "<%=basePath%>user/updateUser";
		form.method="post";
		form.submit();
	}
</script>

  </head>
  
  <body>
    <h1>修改用户</h1>
	<form action="" name="userForm">
		<input type="hidden" name="id" value="${user.id }"/>
		<table>
			<tbody>
				<tr>
					<td>用户名:</td>
					<td><input type="text" name="userName" value="${user.userName }"></td>
				</tr>
				<tr>
					<td>密码:</td>
					<td><input type="text" name="passWord" value=${user.passWord }></td>
				</tr>
				<tr>
					<td>状态:</td>
					<td><select name="state">
						<option value="1" <c:if test="${user.state == 1 }">selected="selected"</c:if>>正常</option>
						<option value="2" <c:if test="${user.state == 2 }">selected="selected"</c:if>>禁用</option>
					</select></td>
				</tr>
				<tr>
					<td>创建时间</td>
					<td><fmt:formatDate value="${user.createTime }" pattern="yyyy年MM月dd日  HH:mm:ss"/></td>
				</tr>
				<tr>
					<td colspan="2"><input type="button" value="保存" onclick="updateUser()"></td>
				</tr>
			</tbody>
		</table>
	</form>
  </body>
  
</html>
